<?php

namespace app\api\controller;

use think\Bb;
use think\Controller;
use think\Db;

class Common extends Controller
{

    public $userInfo = array();

    public function _initialize()
    {
        $signature = "";
        if (!empty($_SERVER['HTTP_X_TOKEN'])) {
            $signature = $_SERVER['HTTP_X_TOKEN'];
            $userInfo = verifyToken($signature);
            $mapUserId['id'] = $userInfo['id'];
            $result = Db::table('admin_user')->where($mapUserId)->find();

            $userInfo['type'] = $result["type"];

            $this->userInfo = $userInfo;
        } else {
            return json(array(
                "code" => 400,
                "data" => array(),
                "message" => "登入异常",
            ));
        }
    }




  
}



